home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 351-375 / 359 / dice / dice.lzh / lib / memory / calloc.c next >
Encoding:
C/C++ Source or Header  |  1990-03-28  |  313 b   |  25 lines

  1.  
  2. /*
  3.  *  CALLOC.C
  4.  *
  5.  *  (c)Copyright 1990, Matthew Dillon, All Rights Reserved
  6.  *
  7.  *  calloc(elmsize, elms)
  8.  */
  9.  
  10. #include <stdlib.h>
  11.  
  12. void *
  13. calloc(elmSize, elms)
  14. size_t elmSize;
  15. size_t elms;
  16. {
  17.     void *ptr;
  18.     long bytes = elmSize * elms;
  19.  
  20.     if (ptr = malloc(bytes))
  21.     clrmem(ptr, bytes);
  22.     return(ptr);
  23. }
  24.  
  25.